package site.marqstree.latte.ui.recycler;

import java.util.LinkedHashMap;

/*
 * 项目名: EleCommerce
 * 包名: site.marqstree.latte.ui.recycler
 * 文件名: MultipleEntityBuilder
 * 创建者: marqstree
 * 创建时间: 2020/1/22 19:52
 * 描述: TODO
 */
public class MultipleEntityBuilder {

    private static final LinkedHashMap<Object, Object> FIELDS = new LinkedHashMap<>();

    public MultipleEntityBuilder() {
        //先清除之前的数据
        FIELDS.clear();
    }

    public final MultipleEntityBuilder setItemType(int itemType) {
        FIELDS.put(MultipleFields.ITEM_TYPE, itemType);
        return this;
    }

    public final MultipleEntityBuilder setField(Object key, Object value) {
        FIELDS.put(key, value);
        return this;
    }

    public final MultipleEntityBuilder setFields(LinkedHashMap<?, ?> map) {
        FIELDS.putAll(map);
        return this;
    }

    public final MultipleItemEntity build() {
        return new MultipleItemEntity(FIELDS);
    }
}
